
import { lazy } from "react";
// 引入路由类型
import { RouterItem, RouterList } from "../utills/type";

// 定义二级路由，包含具体的页面路径和元素，以及标题
export const homeRouters: RouterItem[] = [
    {
        path: '/home/index',
        element: lazy(() => import('../Views/Index/index')),
        title: "首页"
    },
    {
        path: '/home/project',
        element: lazy(() => import('../Views/Project/index')),
        title: "项目"
    },
]

export const listinfoRouters: RouterItem[] = [
    {
        path: '/ListInfo/classid1',
        element: lazy(() => import('../Views/ListInfo/classid1/index')),
        title: "关于我们_公司简介"
    },
    {
        path: '/ListInfo/classid2',
        element: lazy(() => import('../Views/ListInfo/classid2/index')),
        title: "关于我们_公司简介"
    },
    {
        path: '/ListInfo/classid9',
        element: lazy(() => import('../Views/ListInfo/classid9/index')),
        title: "关于我们_公司简介"
    },
    {
        path: '/ListInfo/classid10',
        element: lazy(() => import('../Views/ListInfo/classid10/index')),
        title: "关于我们_荣誉资质"
    },
    {
        path: '/ListInfo/classid11',
        element: lazy(() => import('../Views/ListInfo/classid11/index')),
        title: "关于我们_新闻资讯"
    },
    {
        path: '/ListInfo/classid13',
        element: lazy(() => import('../Views/ListInfo/classid13/index')),
        title: "关于我们_联系我们"
    },
    {
        path: '/ListInfo/classid5',
        element: lazy(() => import('../Views/ListInfo/classid5/index')),
        title: "财税顾问"
    },
    {
        path: '/ListInfo/classid6',
        element: lazy(() => import('../Views/ListInfo/classid6/index')),
        title: "税务筹集"
    },
    {
        path: '/ListInfo/classid7',
        element: lazy(() => import('../Views/ListInfo/classid7/index')),
        title: "产权资质"
    },
    // {
    //     path: '/ListInfo/classid12',
    //     element: lazy(() => import('../Views/ListInfo/classid12/index')),
    //     title: "列表"
    // },
    {
        path: '/ListInfo/classid3',
        element: lazy(() => import('../Views/ListInfo/classid3/index')),
        title: "税务代办"
    },
    {
        path: '/ListInfo/classid4',
        element: lazy(() => import('../Views/ListInfo/classid4/index')),
        title: "公司审计"
    }
]


// 定义一级路由配置，使用history模式
// 包含根路径重定向、home路由、Login路由和默认错误页面
const routerList: RouterList = {
    mode: 'history',
    routes: [
        {
            path: '/',
            to: '/home/index',
        },
        {
            path: '/home',
            element: lazy(() => import('../Views/Home/index')),
            children: homeRouters,// 嵌套子路由
        },
        {
            path: '/ListInfo',
            element: lazy(() => import('../Views/ListInfo/index')),
            children: listinfoRouters,// 嵌套子路由
        },
        {
            path: '*',
            element: lazy(() => import('../Views/Error/index')),
        }
    ]
}
export default routerList// 导出路由配置供其他模块使用